package com.situ.crm.test;

import java.util.concurrent.Callable;

public class CalculateCallable implements Callable {
	private int begin = 0;
	private int end = 0;

	public CalculateCallable(int begin, int end) {
		this.begin = begin;
		this.end = end;
	}

	@Override
	public Object call() throws Exception {
		int result = 0;
		for (int i = begin; i <= end; i++) {
			result += i;
		}

		return Thread.currentThread().getName() + " : " + result;
	}
}
